<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        body,
        html {
            width: 100%;
            height: 100%;
        }
        
        .mask {
            /* display: none; */
            width: 100%;
            height: 100%;
            background-color: rgb(130, 130, 144);
            opacity: 0.3;
            border: 1px solid black;
        }
        
        .login {
            width: 300px;
            height: 100px;
            padding: 10px;
            margin: 100px auto;
            border: 1px solid black;
        }
        
        .login>p {
            margin: 0 10px;
        }
    </style>
</head>

<body>
    <div id="app">
        <button @click="isShow=true">显示模态窗</button>
        <div v-show="isShow" class="mask" @click="isShow=false">
            <div class="login" @click.stop>
                <p>用户名：<input type="text" name="" id=""></p>
                <p>密&emsp;码：<input type="password" name="" id=""></p>
                <hr>
                <p><button>登录</button></p>
            </div>

        </div>
    </div>
</body>

<script>
    var vm = new Vue({
        el: "#app",
        data: {
            isShow: false
        }

    })
</script>

</html>